export type idCardOptionsType = 'front' | 'back';
export interface IdCardOptions {
  type: idCardOptionsType;
  scan: boolean;
}

export interface IdCardFrontResult {
  address: string;
  idNumber: string;
  birthday: string;
  name: string;
  gender: string;
  ethnic: string;
}
export interface IdCardBackResult {
  signDate: string;
  expiryDate: string;
  issueAuthority: string;
}
export interface IdCardResult {
  front: IdCardFrontResult;
  back: IdCardBackResult;
}
export interface BankCardResult {
  bankCardNumber: string;
  bankName: string;
  bankCardType: string;
  validDate: string;
  holderName: string;
}

export interface BaiduOcrPlugin {
  echo(options: { value: string }): Promise<{ value: string }>;
  idCard<K extends idCardOptionsType>(
    options: IdCardOptions,
  ): Promise<IdCardResult[K]>;
  bankCard(): Promise<BankCardResult>;
}
